package hyj.qx.kuaican.exception;

import hyj.qx.kuaican.model.ErrorCode;

public class BusinessException extends RuntimeException{
    private ErrorCode errorCode;

    public BusinessException(ErrorCode errorCode){
        super(errorCode.getCode());
        this.errorCode =errorCode;
    }
    public String getMsg(){
        return this.errorCode.getMessage();
    }
    public String getCode(){
        return this.errorCode.getCode();
    }
    public ErrorCode getErrorCode(){
        return this.errorCode;
    }
}
